import java.util.Scanner;

public class MonthDaysCalculator {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个年份");
        int year = scanner.nextInt();
        System.out.print("请输入月份（1-12）：");
        int month = scanner.nextInt();
        if (month < 1 || month > 12) {
            System.out.println("无效的月份输入。");
            return;
        }
        int daysInMonth = 0;
        if (month == 2) {
            // 检查是否为闰年
            boolean isLeapYear = (year % 4 == 0 && (year % 100!= 0 || year % 400 == 0));
            if (isLeapYear) {
                daysInMonth = 29;
            } else {
                daysInMonth = 28;
            }
        } else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
            daysInMonth = 31;
        } else {
            daysInMonth = 30;
        }
        System.out.println("该月份有 " + daysInMonth + " 天。");
    }
}